<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://unpkg.com/react@16/umd/react.development.js" crossorigin></script>
    <script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js" crossorigin></script>
    <script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
</head>
<body>
    <div id="app"></div>
    <script type="text/babel">
        //第一个参数是渲染内容第二个是渲染参数
      class App extends React.Component{
          constructor(){
              super()
              this.state={
                  msg:"pikd"
              }
          }
          render(){
              return (
            <div>
                <h2>{this.state.msg}</h2>
            <button onClick={this.btnClick.bind(this)}>修改</button>
            </div>
              )
          }
          btnClick(){
              this.setState({
                  msg:"3131312"
              })
            
          }
      }
    
        ReactDOM.render(<App/> , document.getElementById("app"))
    
       render()
    </script>
</body>
</html>